import type { RouteRecordRaw } from "vue-router";

// 错误页面模块
const userRouter: Array<RouteRecordRaw> = [
	{
		path: "/user",
		name: "user",
		component: () => import("@/views/user/index.vue"),
		meta: {
			requiresAuth: true,
			title: "个人中心",
			key: "个人中心"
		}
	},
	{
		path: "/userhomepage/:userid",
		name: "user-homepage",
		component: () => import("@/views/user-homepage/index.vue"),
		meta: {
			requiresAuth: false,
			title: "用户主页",
			key: "用户主页"
		},
		children: [
			{
				path: "",
				name: "home",
				component: () => import("@/views/user-homepage/components/home.vue"),
				meta: {
					requiresAuth: false,
					title: "用户的主页",
					key: "用户的主页"
				}
			},
			{
				path: "management",
				name: "management",
				component: () => import("@/views/user-homepage/components/management.vue"),
				meta: {
					requiresAuth: true,
					title: "用户管理中心",
					key: "用户管理中心"
				}
			}
		]
	}
];

export default userRouter;
